import axiosApi from "./AxiosApi.js";

// 样本递送
const sampleDelivery = {
  page: {
    url: `/xssc/sampleDelivery/refreshSample`,
    method: "POST"
  },
  // 递送详情
  waitDeliverySample: {
    url: `/xssc/sampleDelivery/waitDeliverySample`,
    method: "POST"
  },
  // 保存
  deliverySave: {
    url: `/xssc/sampleDelivery/deliverySave`,
    method: "POST"
  }
};

// 筛查中心递送
const screeningCenterDelivery = {
  page: {
    url: `/xssc/experimentDeliverySample/queryByExperiment`,
    method: "POST"
  },
  // 递送详情
  waitDeliverySample: {
    url: `/xssc/experimentDeliverySample/waitExperimentDelivery`,
    method: "POST"
  },
  // 保存
  deliverySave: {
    url: `/xssc/experimentDeliverySample/saveExperimentDelivery`,
    method: "POST"
  }
};

// 打印递送单

const printDeliveryOrder = {
  page: {
    url: `/xssc/printdeliveryorder/page`,
    method: "POST"
  },
  // 打印
  printExpressDetail: {
    url: `/xssc/printdeliveryorder/printExpressDetail`,
    method: "PUT"
  },
  // 批号详情
  selectBlood: {
    url: `/xssc/printdeliveryorder/selectBlood`,
    method: "PUT"
  },
  // 修改递送验收
  updateExpress: {
    url: `/xssc/printdeliveryorder/updateExpress`,
    method: "PUT"
  }
};

// 验收查询
const checkSearch = {
  page: {
    url: `/xssc/sampleExpress/page`,
    method: "POST"
  }
};

export default {
  sampleDelivery: {
    page(data) {
      return axiosApi({
        ...sampleDelivery.page,
        // formData: true,
        data
      });
    },
    waitDeliverySample(data) {
      return axiosApi({
        ...sampleDelivery.waitDeliverySample,
        // formData: true,
        data
      });
    },
    deliverySave(data) {
      return axiosApi({
        ...sampleDelivery.deliverySave,
        // formData: true,
        data
      });
    }
  },
  screeningCenterDelivery: {
    page(data) {
      return axiosApi({
        ...screeningCenterDelivery.page,
        // formData: true,
        data
      });
    },
    waitDeliverySample(data) {
      return axiosApi({
        ...screeningCenterDelivery.waitDeliverySample,
        // formData: true,
        data
      });
    },
    deliverySave(data) {
      return axiosApi({
        ...screeningCenterDelivery.deliverySave,
        // formData: true,
        data
      });
    }
  },
  printDeliveryOrder: {
    page(data) {
      return axiosApi({
        ...printDeliveryOrder.page,
        // formData: true,
        data
      });
    },
    printExpressDetail(data) {
      return axiosApi({
        ...printDeliveryOrder.printExpressDetail,
        // formData: true,
        data
      });
    },
    selectBlood(data) {
      return axiosApi({
        ...printDeliveryOrder.selectBlood,
        // formData: true,
        data
      });
    },
    updateExpress(data) {
      return axiosApi({
        ...printDeliveryOrder.updateExpress,
        // formData: true,
        data
      });
    }
  },
  checkSearch: {
    page(data) {
      return axiosApi({
        ...checkSearch.page,
        // formData: true,
        data
      });
    }
  }
};
